﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Abp.Application.Services.Dto;
using Abp.Domain.Repositories;
using SingleUserMall.BargainItemDetail.VO;
using SingleUserMall.Common;

namespace SingleUserMall.BargainItemDetail
{
    public class BargainItemDetailAppService : SingleUserMallAppServiceBase, IBargainItemDetailAppService
    {
        private readonly IRepository<BargainItemDetails, long> _bargainItemDetailRepository;
        public BargainItemDetailAppService(IRepository<BargainItemDetails, long> bargainItemDetailRepository)
        {
            _bargainItemDetailRepository = bargainItemDetailRepository;

        }
        public  async Task<PagedResultDto<BargainItemDetailsVO>> GetBargainItemDetailAsync(PagedForm form)
        {
            var query = _bargainItemDetailRepository.GetAll().OrderByDescending(x=>x.CreationTime);
            return await query.ToPagedResultDtoAsync<BargainItemDetails, BargainItemDetailsVO>(form,(i,vo) => { });
        }
    }
}
